<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<p:dialog widgetVar="workflowImportWidgetVar" modal="true"
          resizable="false" width="1200" height="600" header="流程管理">
    <div class="clearfix"
         style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
        <p:toolbar>
            <f:facet name="right">
                <p:commandButton value="导入" icon="fa fa-upload"
                                 actionListener="#{workflowDefinitionBean.onImport}"
                                 oncomplete="PF('workflowImportWidgetVar').hide()"/>
            </f:facet>
        </p:toolbar>
    </div>
    <div class="ui-fluid">
        <div class="ui-g-12">
            <div class="card">
                <div class="ui-g">
                    <div class="ui-g-12"><h3><b>导入流程</b></h3></div>
                    <div class="ui-g-2">
                        <p:outputLabel value="流程分类"/>
                    </div>
                    <div class="ui-g-4">
                        <p:selectOneMenu id="test"
                                         value="#{workflowDefinitionBean.importCategory}"
                                         filter="true"
                                         filterMatchMode="contains">
                            <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                            <f:selectItems
                                    value="#{workflowDefinitionBean.dictionaries[DictionaryCode.WORKFLOW_CATEGORY]}"
                                    var="dic"
                                    itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                        </p:selectOneMenu>
                    </div>
                    <div class="ui-g-6"></div>
                    <div class="ui-g-12">
                        <p:fileUpload
                                fileUploadListener="#{workflowDefinitionBean.onUploadBpmn}"
                                mode="advanced"
                                fileLimit="1"
                                fileLimitMessage="只能上传一个文件"
                                invalidFileMessage="请上传BPMN文件"
                                invalidSizeMessage="文件过大"
                                sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                                allowTypes="/(\.|\/)(bpmn)$/"
                                label="打开" cancelLabel="取消" uploadLabel="上传"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</p:dialog>

</html>
